<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .cutLi{text-decoration: line-through;}
    </style>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app">
        事项：<input type="text" placeholder="请输入待办事项" v-model="thing" @keyup.enter="add"> 
        <ul>
            <li v-for="item in items" v-on:click="cut">{{item}}</li>
        </ul>
    </div>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                thing:'',
                items:[
                    '上午9点开需求分析会','中午吃饭睡觉打豆豆','下午5点下班前验收项目'
                ]
            },
            methods:{
                add(){
                    this.items.push(this.thing);
                    this.thing = '';
                },
                cut(event){
                    event.target.className = 'cutLi'
                }
            }
        })
    </script>
</body>
</html>